home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / SAMPLES.BIN / Applet1.java < prev    next >
Encoding:
Java Source  |  1996-12-03  |  4.6 KB  |  184 lines

  1. /*
  2.     A basic extension of the java.applet.Applet class
  3.  */
  4.  
  5. import java.awt.*;
  6. import java.applet.*;
  7.  
  8. public class Applet1 extends Applet {
  9.     void button1_Clicked(Event event) {
  10.  
  11.  
  12.         //{{CONNECTION
  13.         // Hide the Applet
  14.         hide();
  15.         //}}
  16.     }
  17.  
  18.     void About_Clicked(Event event) {
  19.  
  20.  
  21.         //{{CONNECTION
  22.         // Create and show the Frame with a title...
  23.         (new About("Multimedia Sample About Box...")).show();
  24.         //}}
  25.     }
  26.  
  27.     void Plasma_Clicked(Event event) {
  28.  
  29.  
  30.         //{{CONNECTION
  31.         // Create and show the Frame with a title...
  32.         (new Plasma("Visual Cafe Plasma Sample")).show();
  33.         //}}
  34.     }
  35.  
  36.     void Fireworks_Clicked(Event event) {
  37.  
  38.  
  39.         //{{CONNECTION
  40.         // Create and show the Frame with a title...
  41.         (new Fireworks("Visual Cafe Fireworks Sample")).show();
  42.         //}}
  43.     }
  44.  
  45.     void Sound_Clicked(Event event) {
  46.  
  47.  
  48.         //{{CONNECTION
  49.         // Create and show the Frame with a title...
  50.         (new Sound("Visual Cafe Sound Player Sample")).show();
  51.         //}}
  52.     }
  53.  
  54.     void Animation_Clicked(Event event) {
  55.  
  56.  
  57.         //{{CONNECTION
  58.         // Create and show the Frame with a title...
  59.         (new Animation("Visual Cafe Moving Animation Sample")).show();
  60.         //}}
  61.     }
  62.  
  63.     void Slideshow_Clicked(Event event) {
  64.  
  65.  
  66.         //{{CONNECTION
  67.         // Create and show the Frame with a title...
  68.         (new Slideshow("Visual Cafe Slideshow Sample")).show();
  69.         //}}
  70.     }
  71.  
  72.     void Emblaze_Clicked(Event event) {
  73.  
  74.  
  75.         //{{CONNECTION
  76.         // Create and show the Frame with a title...
  77.         (new Emblaze("Visual Cafe Emblaze Sample")).show();
  78.         //}}
  79.     }
  80.  
  81.  
  82.     public void init() {
  83.         super.init();
  84.  
  85.         // Take out this line if you don't use symantec.itools.net.RelativeURL
  86.         symantec.itools.lang.Context.setDocumentBase(getDocumentBase());
  87.  
  88.         //{{INIT_CONTROLS
  89.         setLayout(null);
  90.         addNotify();
  91.         resize(426,237);
  92.         setBackground(new Color(4227200));
  93.         borderPanel1 = new symantec.itools.awt.BorderPanel();
  94.         borderPanel1.setLayout(null);
  95.         borderPanel1.reshape(33,12,361,206);
  96.         add(borderPanel1);
  97.         borderPanel1.setLabel("Visual Cafe Multimedia Samples");
  98.         borderPanel1.setLabelColor(new Color(0));
  99.         borderPanel1.setAlignStyle(symantec.itools.awt.BorderPanel.ALIGN_LEFT);
  100.         borderPanel1.setPaddingTop(10);
  101.         borderPanel1.setPaddingBottom(6);
  102.         borderPanel1.setPaddingLeft(6);
  103.         borderPanel1.setPaddingRight(6);
  104.         borderPanel1.setIPadTop(2);
  105.         borderPanel1.setIPadBottom(7);
  106.         borderPanel1.setIPadSides(4);
  107.         borderPanel1.setBorderColor(new Color(0));
  108.         borderPanel1.setBevelStyle(symantec.itools.awt.BorderPanel.BEVEL_LINE);
  109.         Emblaze = new java.awt.Button("Emblaze");
  110.         Emblaze.reshape(10,14,92,24);
  111.         borderPanel1.add(Emblaze);
  112.         Slideshow = new java.awt.Button("Slideshow");
  113.         Slideshow.reshape(10,66,92,24);
  114.         borderPanel1.add(Slideshow);
  115.         Sound = new java.awt.Button("Sound Player");
  116.         Sound.reshape(120,66,92,24);
  117.         borderPanel1.add(Sound);
  118.         Animation = new java.awt.Button("Animation");
  119.         Animation.reshape(120,14,92,24);
  120.         borderPanel1.add(Animation);
  121.         Plasma = new java.awt.Button("Plasma");
  122.         Plasma.reshape(230,66,92,24);
  123.         borderPanel1.add(Plasma);
  124.         Fireworks = new java.awt.Button("Fireworks");
  125.         Fireworks.reshape(230,14,92,24);
  126.         borderPanel1.add(Fireworks);
  127.         About = new java.awt.Button("About");
  128.         About.reshape(43,141,92,24);
  129.         borderPanel1.add(About);
  130.         button1 = new java.awt.Button("Close");
  131.         button1.reshape(210,141,92,24);
  132.         borderPanel1.add(button1);
  133.         //}}
  134.     }
  135.  
  136.     public boolean handleEvent(Event event) {
  137.         if (event.target == Emblaze && event.id == Event.ACTION_EVENT) {
  138.             Emblaze_Clicked(event);
  139.             return true;
  140.         }
  141.         if (event.target == Slideshow && event.id == Event.ACTION_EVENT) {
  142.             Slideshow_Clicked(event);
  143.             return true;
  144.         }
  145.         if (event.target == Animation && event.id == Event.ACTION_EVENT) {
  146.             Animation_Clicked(event);
  147.             return true;
  148.         }
  149.         if (event.target == Sound && event.id == Event.ACTION_EVENT) {
  150.             Sound_Clicked(event);
  151.             return true;
  152.         }
  153.         if (event.target == Fireworks && event.id == Event.ACTION_EVENT) {
  154.             Fireworks_Clicked(event);
  155.             return true;
  156.         }
  157.         if (event.target == Plasma && event.id == Event.ACTION_EVENT) {
  158.             Plasma_Clicked(event);
  159.             return true;
  160.         }
  161.         if (event.target == About && event.id == Event.ACTION_EVENT) {
  162.             About_Clicked(event);
  163.             return true;
  164.         }
  165.         if (event.target == button1 && event.id == Event.ACTION_EVENT) {
  166.             button1_Clicked(event);
  167.             return true;
  168.         }
  169.         return super.handleEvent(event);
  170.     }
  171.  
  172.     //{{DECLARE_CONTROLS
  173.     symantec.itools.awt.BorderPanel borderPanel1;
  174.     java.awt.Button Emblaze;
  175.     java.awt.Button Slideshow;
  176.     java.awt.Button Sound;
  177.     java.awt.Button Animation;
  178.     java.awt.Button Plasma;
  179.     java.awt.Button Fireworks;
  180.     java.awt.Button About;
  181.     java.awt.Button button1;
  182.     //}}
  183. }
  184.